package com.uenpay.im.ui.old.activity.wallet;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.uenpay.im.IMApplication;
import com.uenpay.im.R;
import com.uenpay.util.app.base.BaseActivity;

import java.text.MessageFormat;


/**
 * @author SL
 * @version 1.0
 * @E-mail:
 * @date 创建时间：2016-7-4 下午1:50:33
 * @parameter
 * @Function 提现详情
 */
public class CashDetailActivity extends BaseActivity {

    private TextView cash_crad_tv, cash_amount_tv, cash_counter_fee_tv;
    private String amount, bankname, bankcard;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        isFullScreen = true;
        super.onCreate(savedInstanceState);
    }

    @Override
    public View bindView() {
        return null;
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_cash_detail_layout;
    }

    @Override
    public void initView(View view) {
        bankname = getIntent().getStringExtra("bankname");
        bankcard = getIntent().getStringExtra("bankcard");
        amount = getIntent().getStringExtra("amount");
        initView();
        initListener();
    }

    protected void initView() {
        cash_counter_fee_tv = (TextView) findViewById(R.id.cash_counter_fee_tv);
        cash_crad_tv = (TextView) findViewById(R.id.cash_crad_tv);
        cash_amount_tv = (TextView) findViewById(R.id.cash_amount_tv);
        cash_crad_tv.setText(bankname
                + " "
                + MessageFormat.format(
                getResources().getString(R.string.last_num),
                bankcard.substring(bankcard.length() - 4,
                        bankcard.length())));
        cash_amount_tv.setText("¥" + amount);
    }

    protected void initListener() {
        findViewById(R.id.back_layout).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                setResult(RESULT_OK);
                finish();
            }
        });

        findViewById(R.id.submit_btn).setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                setResult(RESULT_OK);
                finish();
            }
        });
    }

    @Override
    public void onBackPressed() {
        setResult(RESULT_OK);
        finish();
    }

}
